package com.nervenets.template.service;

import com.alibaba.fastjson.JSONObject;
import com.nervenets.general.entity.Selection;
import com.nervenets.general.service.CacheableService;
import com.nervenets.template.hibernate.domain.user.User;
import com.nervenets.template.hibernate.domain.user.UserExtra;
import com.nervenets.template.hibernate.domain.user.UserWxId;
import me.chanjar.weixin.common.bean.WxOAuth2UserInfo;

import java.util.List;

public interface UserService extends CacheableService<User> {
    User findByMobile(String mobile);

    void saveUserExtras(User user, JSONObject extra);

    User findByOpenId(String openId);

    User findByUnionId(String unionId);

    void saveUserWxId(User user, WxOAuth2UserInfo wxMpUser, String appId);

    UserWxId findUserWxId(User user, String appId);

    void saveUserExtra(User user, String key, String value);

    UserExtra findUserExtra(User user, String key);

    List<Selection> genderSelections();
}
